﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Collections;
using Ras2ClassLib;

namespace Ras2
{
	public partial class NewSongDlg : Form
	{
		public Lag m_song = new Lag();
		public NewSongDlg()
		{
			InitializeComponent();
			m_comboPerformer.Items.Clear();
			FlytjandiDoc doc = new FlytjandiDoc();
			FlytjandiCollection performers = doc.GetAllFlytjandi();
			
			foreach (Flytjandi performer in performers)
			{
				m_comboPerformer.Items.Add(GetPerformerObject(performer));
			}
		}

		private object GetPerformerObject(Flytjandi performer)
		{
			object item = new object();
			item = performer;
			return item;
		}

		public Lag Song
		{
			get
			{
				m_song.Name = m_txtName.Text;
				m_song.Mp3Path = m_txtMP3.Text;
				m_song.Description = m_txtDescription.Text;
				Flytjandi performer = m_comboPerformer.SelectedItem as Flytjandi;
				m_song.PerformersID = performer.ID;
				return m_song;
			}
			set
			{
				m_song = value;
				m_txtName.Text = m_song.Name;
				m_txtMP3.Text = m_song.Mp3Path; ;
				m_txtDescription.Text = m_song.Description;
			}
		}
	}
}